<!--
  @author heguanghua
  @since 2020/04/24 10:45
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/common::jscss"/>
<body>

<div class="layui-fluid"
     th:with="hasDetail=${#authPermit.checkPermit('/role/detail.action')},
     hasList=${#authPermit.checkPermit('/permit/role/list.action')},
     hasRoleCancel=${#authPermit.checkPermit('/permit/role/modify/cancel.action') && isAssignAdmin},
     hasAddRole=${#authPermit.checkPermit('/permit/role/modify/add.action') && isAssignAdmin}">

    <blockquote class="layui-crumb">
        <a th:lay-href="|${SYS_MCC}/permit/list.action|">权限管理</a>&nbsp;&nbsp;>&nbsp;
        <a th:lay-href="|${SYS_MCC}/permit/detail.action?permitId=${obj.permitId}|" th:lay-text="权限信息" th:text="${obj.permitName}">permitName</a>&nbsp;&nbsp;>&nbsp;
        已分配角色
    </blockquote>

    <div class="layui-card">
        <div class="layui-tab layui-tab-brief">
            <ul class="layui-tab-title">
                <li><a th:lay-href="|${SYS_MCC}/permit/detail.action?permitId=${obj.permitId}|" lay-text="权限信息">权限信息</a></li>
                <li class="layui-this"><a th:lay-href="|${SYS_MCC}/permit/role/list.action?permitId=${obj.permitId}|" lay-text="已分配角色">已分配角色</a></li>
            </ul>
        </div>

        <form method="POST" class="layui-form" action="/permit/role/list.action">
            <div th:replace="permit/role/_query::query"></div>
        </form>

        <div class="layui-card-body">
            <div th:replace="permit/role/_table::table"></div>
            <script type="text/html" id="zmn-table-tool">
                <div class="layui-btn-container">
                    <div class="layui-btn-group">
                        <button class="layui-btn layui-btn-sm" lay-event="cancel" th:if="${hasRoleCancel}">取消分配</button>
                    </div>
                    <div class="layui-btn-group">
                        <button class="layui-btn layui-btn-sm layui-btn-primary" lay-event="add" th:if="${hasAddRole}">+新增授权</button>
                    </div>
                </div>
            </script>
        </div>
    </div>

</div>
</body>
</html>

<script type="text/javascript" th:inline="javascript">

    var json = {
        permitId: [[${vo.permitId}]],
        status: [[${vo.status}]],
        totalCount: [[${vo.totalCount}]],
        pageSize: [[${vo.pageSize}]],
        pageIndex: [[${vo.pageIndex}]]
    };

    layui.extend({
        permit_role_list: "permit/zmn.permit.role.list"
    }).use(['index', 'permit_role_list']);

</script>
